home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Dialogs.a < prev    next >
Text File  |  1996-05-01  |  13KB  |  553 lines

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  19. __DIALOGS__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  25.     include 'Memory.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  31.     include 'Controls.a'
  32.     ENDIF
  33.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  34.     include 'Windows.a'
  35.     ENDIF
  36.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  37.     include 'TextEdit.a'
  38.     ENDIF
  39.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  40.     include 'Events.a'
  41.     ENDIF
  42.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  43.  
  44. ctrlItem                        EQU        4
  45. btnCtrl                            EQU        0
  46. chkCtrl                            EQU        1
  47. radCtrl                            EQU        2
  48. resCtrl                            EQU        3
  49. statText                        EQU        8
  50. editText                        EQU        16
  51. iconItem                        EQU        32
  52. picItem                            EQU        64
  53. userItem                        EQU        0
  54. itemDisable                        EQU        128
  55. ok                                EQU        1
  56. cancel                            EQU        2
  57. stopIcon                        EQU        0
  58. noteIcon                        EQU        1
  59. cautionIcon                        EQU        2
  60.  
  61.                                                             ; new, more standard names for dialog item constants 
  62. kControlDialogItem                EQU        4
  63. kButtonDialogItem                EQU        4
  64. kCheckBoxDialogItem                EQU        5
  65. kRadioButtonDialogItem            EQU        6
  66. kResourceControlDialogItem        EQU        7
  67. kStaticTextDialogItem            EQU        8
  68. kEditTextDialogItem                EQU        16
  69. kIconDialogItem                    EQU        32
  70. kPictureDialogItem                EQU        64
  71. kUserDialogItem                    EQU        0                    ; misc. constants 
  72. kItemDisableBit                    EQU        128
  73. kStdOkItemIndex                    EQU        1
  74. kStdCancelItemIndex                EQU        2                    ; standard icon resource id's 
  75. kStopIcon                        EQU        0
  76. kNoteIcon                        EQU        1
  77. kCautionIcon                    EQU        2
  78.     IF OLDROUTINENAMES THEN
  79. ;
  80. ; These constants lived briefly on ETO 16.  They suggest
  81. ; that there is only one index you can use for the OK 
  82. ; item, which is not true.  You can put the ok item 
  83. ; anywhere you want in the DITL.
  84. ;
  85.  
  86. kOkItemIndex                    EQU        1
  87. kCancelItemIndex                EQU        2
  88.     ENDIF
  89. ;     Dialog Item List Manipulation Constants    
  90. ; typedef SInt16                         DITLMethod
  91.  
  92.  
  93. overlayDITL                        EQU        0
  94. appendDITLRight                    EQU        1
  95. appendDITLBottom                EQU        2
  96. ; typedef SInt16                         StageList
  97.  
  98. ; typedef DialogPtr                     DialogRef
  99.  
  100. DialogRecord            RECORD 0
  101. window                     ds        WindowRecord    ; offset: $0 (0)
  102. items                     ds.l    1                ; offset: $9C (156)
  103. textH                     ds.l    1                ; offset: $A0 (160)
  104. editField                 ds.w    1                ; offset: $A4 (164)
  105. editOpen                 ds.w    1                ; offset: $A6 (166)
  106. aDefItem                 ds.w    1                ; offset: $A8 (168)
  107. sizeof                     EQU *                    ; size:   $AA (170)
  108.                         ENDR
  109. ; typedef struct DialogRecord *            DialogPeek
  110.  
  111. DialogTemplate            RECORD 0
  112. boundsRect                 ds        Rect            ; offset: $0 (0)
  113. procID                     ds.w    1                ; offset: $8 (8)
  114. visible                     ds.b    1                ; offset: $A (10)
  115. filler1                     ds.b    1                ; offset: $B (11)
  116. goAwayFlag                 ds.b    1                ; offset: $C (12)
  117. filler2                     ds.b    1                ; offset: $D (13)
  118. refCon                     ds.l    1                ; offset: $E (14)
  119. itemsID                     ds.w    1                ; offset: $12 (18)
  120. title                     ds        Str255            ; offset: $14 (20)
  121. sizeof                     EQU *                    ; size:   $114 (276)
  122.                         ENDR
  123. ; typedef struct DialogTemplate *        DialogTPtr
  124.  
  125. ; typedef DialogTPtr *                    DialogTHndl
  126.  
  127. AlertTemplate            RECORD 0
  128. boundsRect                 ds        Rect            ; offset: $0 (0)
  129. itemsID                     ds.w    1                ; offset: $8 (8)
  130. stages                     ds.w    1                ; offset: $A (10)
  131. sizeof                     EQU *                    ; size:   $C (12)
  132.                         ENDR
  133. ; typedef struct AlertTemplate *        AlertTPtr
  134.  
  135. ; typedef AlertTPtr *                    AlertTHndl
  136.  
  137. ;  new type abstractions for the dialog manager 
  138. ; typedef SInt16                         DialogItemIndexZeroBased
  139.  
  140. ; typedef SInt16                         DialogItemIndex
  141.  
  142. ; typedef SInt16                         DialogItemType
  143.  
  144. ;  dialog manager callbacks 
  145. ;
  146. ;    NOTE: Code running under MultiFinder or System 7.0 or newer
  147. ;    should always pass NULL to InitDialogs.
  148. ;
  149. ;
  150. ; pascal void InitDialogs(void *ignored)
  151. ;
  152.     IF ¨ GENERATINGCFM THEN
  153.         _InitDialogs:    OPWORD    $A97B
  154.     ELSE
  155.         IMPORT_CFM_FUNCTION InitDialogs
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal void ErrorSound(SoundUPP soundProc)
  160. ;
  161.     IF ¨ GENERATINGCFM THEN
  162.         _ErrorSound:    OPWORD    $A98C
  163.     ELSE
  164.         IMPORT_CFM_FUNCTION ErrorSound
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal DialogRef NewDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle itmLstHndl)
  169. ;
  170.     IF ¨ GENERATINGCFM THEN
  171.         _NewDialog:    OPWORD    $A97D
  172.     ELSE
  173.         IMPORT_CFM_FUNCTION NewDialog
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal DialogRef GetNewDialog(SInt16 dialogID, void *dStorage, WindowRef behind)
  178. ;
  179.     IF ¨ GENERATINGCFM THEN
  180.         _GetNewDialog:    OPWORD    $A97C
  181.     ELSE
  182.         IMPORT_CFM_FUNCTION GetNewDialog
  183.     ENDIF
  184.  
  185. ;
  186. ; pascal DialogRef NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  187. ;
  188.     IF ¨ GENERATINGCFM THEN
  189.         _NewColorDialog:    OPWORD    $AA4B
  190.     ELSE
  191.         IMPORT_CFM_FUNCTION NewColorDialog
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal void CloseDialog(DialogRef theDialog)
  196. ;
  197.     IF ¨ GENERATINGCFM THEN
  198.         _CloseDialog:    OPWORD    $A982
  199.     ELSE
  200.         IMPORT_CFM_FUNCTION CloseDialog
  201.     ENDIF
  202.  
  203. ;
  204. ; pascal void DisposeDialog(DialogRef theDialog)
  205. ;
  206.     IF ¨ GENERATINGCFM THEN
  207.         _DisposeDialog:    OPWORD    $A983
  208.     ELSE
  209.         IMPORT_CFM_FUNCTION DisposeDialog
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
  214. ;
  215.     IF ¨ GENERATINGCFM THEN
  216.         _ModalDialog:    OPWORD    $A991
  217.     ELSE
  218.         IMPORT_CFM_FUNCTION ModalDialog
  219.     ENDIF
  220.  
  221. ;
  222. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  223. ;
  224.     IF ¨ GENERATINGCFM THEN
  225.         _IsDialogEvent:    OPWORD    $A97F
  226.     ELSE
  227.         IMPORT_CFM_FUNCTION IsDialogEvent
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogRef *theDialog, DialogItemIndex *itemHit)
  232. ;
  233.     IF ¨ GENERATINGCFM THEN
  234.         _DialogSelect:    OPWORD    $A980
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION DialogSelect
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal void DrawDialog(DialogRef theDialog)
  241. ;
  242.     IF ¨ GENERATINGCFM THEN
  243.         _DrawDialog:    OPWORD    $A981
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION DrawDialog
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal void UpdateDialog(DialogRef theDialog, RgnHandle updateRgn)
  250. ;
  251.     IF ¨ GENERATINGCFM THEN
  252.         _UpdateDialog:    OPWORD    $A978
  253.     ELSE
  254.         IMPORT_CFM_FUNCTION UpdateDialog
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal void HideDialogItem(DialogRef theDialog, DialogItemIndex itemNo)
  259. ;
  260.     IF ¨ GENERATINGCFM THEN
  261.         _HideDialogItem:    OPWORD    $A827
  262.     ELSE
  263.         IMPORT_CFM_FUNCTION HideDialogItem
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void ShowDialogItem(DialogRef theDialog, DialogItemIndex itemNo)
  268. ;
  269.     IF ¨ GENERATINGCFM THEN
  270.         _ShowDialogItem:    OPWORD    $A828
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION ShowDialogItem
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal DialogItemIndexZeroBased FindDialogItem(DialogRef theDialog, Point thePt)
  277. ;
  278.     IF ¨ GENERATINGCFM THEN
  279.         _FindDialogItem:    OPWORD    $A984
  280.     ELSE
  281.         IMPORT_CFM_FUNCTION FindDialogItem
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
  286. ;
  287.     IF ¨ GENERATINGCFM THEN
  288.         _Alert:    OPWORD    $A985
  289.     ELSE
  290.         IMPORT_CFM_FUNCTION Alert
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  295. ;
  296.     IF ¨ GENERATINGCFM THEN
  297.         _StopAlert:    OPWORD    $A986
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION StopAlert
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  304. ;
  305.     IF ¨ GENERATINGCFM THEN
  306.         _NoteAlert:    OPWORD    $A987
  307.     ELSE
  308.         IMPORT_CFM_FUNCTION NoteAlert
  309.     ENDIF
  310.  
  311. ;
  312. ; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  313. ;
  314.     IF ¨ GENERATINGCFM THEN
  315.         _CautionAlert:    OPWORD    $A988
  316.     ELSE
  317.         IMPORT_CFM_FUNCTION CautionAlert
  318.     ENDIF
  319.  
  320. ;
  321. ; pascal void GetDialogItem(DialogRef theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
  322. ;
  323.     IF ¨ GENERATINGCFM THEN
  324.         _GetDialogItem:    OPWORD    $A98D
  325.     ELSE
  326.         IMPORT_CFM_FUNCTION GetDialogItem
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal void SetDialogItem(DialogRef theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
  331. ;
  332.     IF ¨ GENERATINGCFM THEN
  333.         _SetDialogItem:    OPWORD    $A98E
  334.     ELSE
  335.         IMPORT_CFM_FUNCTION SetDialogItem
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  340. ;
  341.     IF ¨ GENERATINGCFM THEN
  342.         _ParamText:    OPWORD    $A98B
  343.     ELSE
  344.         IMPORT_CFM_FUNCTION ParamText
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal void SelectDialogItemText(DialogRef theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
  349. ;
  350.     IF ¨ GENERATINGCFM THEN
  351.         _SelectDialogItemText:    OPWORD    $A97E
  352.     ELSE
  353.         IMPORT_CFM_FUNCTION SelectDialogItemText
  354.     ENDIF
  355.  
  356. ;
  357. ; pascal void GetDialogItemText(Handle item, Str255 text)
  358. ;
  359.     IF ¨ GENERATINGCFM THEN
  360.         _GetDialogItemText:    OPWORD    $A990
  361.     ELSE
  362.         IMPORT_CFM_FUNCTION GetDialogItemText
  363.     ENDIF
  364.  
  365. ;
  366. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  367. ;
  368.     IF ¨ GENERATINGCFM THEN
  369.         _SetDialogItemText:    OPWORD    $A98F
  370.     ELSE
  371.         IMPORT_CFM_FUNCTION SetDialogItemText
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal SInt16 GetAlertStage(void)
  376. ;
  377.     IF ¨ GENERATINGCFM THEN
  378.         Macro
  379.         _GetAlertStage        &dest=(sp)
  380.             move.w            $0A9A,&dest
  381.         EndM
  382.     ELSE
  383.         IMPORT_CFM_FUNCTION GetAlertStage
  384.     ENDIF
  385.  
  386. ;
  387. ; pascal void SetDialogFont(SInt16 value)
  388. ;
  389.     IF ¨ GENERATINGCFM THEN
  390.         Macro
  391.         _SetDialogFont        &src=(sp)+
  392.             move.w            &src,$0AFA
  393.         EndM
  394.     ELSE
  395.         IMPORT_CFM_FUNCTION SetDialogFont
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal void ResetAlertStage(void )
  400. ;
  401.     IF ¨ GENERATINGCFM THEN
  402.         Macro
  403.         _ResetAlertStage
  404.             clr.w               $0A9A
  405.         EndM
  406.     ELSE
  407.         IMPORT_CFM_FUNCTION ResetAlertStage
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal void AppendDITL(DialogRef theDialog, Handle theHandle, DITLMethod method)
  412. ;
  413.     IF GENERATINGCFM THEN
  414.         IMPORT_CFM_FUNCTION AppendDITL
  415.     ENDIF
  416.  
  417. ;
  418. ; pascal DialogItemIndex CountDITL(DialogRef theDialog)
  419. ;
  420.     IF GENERATINGCFM THEN
  421.         IMPORT_CFM_FUNCTION CountDITL
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal void ShortenDITL(DialogRef theDialog, DialogItemIndex numberItems)
  426. ;
  427.     IF GENERATINGCFM THEN
  428.         IMPORT_CFM_FUNCTION ShortenDITL
  429.     ENDIF
  430.  
  431. ;
  432. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  433. ;
  434.     IF ¨ GENERATINGCFM THEN
  435.         Macro
  436.         _GetStdFilterProc
  437.             move.w              #$0203,D0
  438.             dc.w                $AA68
  439.         EndM
  440.     ELSE
  441.         IMPORT_CFM_FUNCTION GetStdFilterProc
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal OSErr SetDialogDefaultItem(DialogRef theDialog, DialogItemIndex newItem)
  446. ;
  447.     IF ¨ GENERATINGCFM THEN
  448.         Macro
  449.         _SetDialogDefaultItem
  450.             move.w              #$0304,D0
  451.             dc.w                $AA68
  452.         EndM
  453.     ELSE
  454.         IMPORT_CFM_FUNCTION SetDialogDefaultItem
  455.     ENDIF
  456.  
  457. ;
  458. ; pascal OSErr SetDialogCancelItem(DialogRef theDialog, DialogItemIndex newItem)
  459. ;
  460.     IF ¨ GENERATINGCFM THEN
  461.         Macro
  462.         _SetDialogCancelItem
  463.             move.w              #$0305,D0
  464.             dc.w                $AA68
  465.         EndM
  466.     ELSE
  467.         IMPORT_CFM_FUNCTION SetDialogCancelItem
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal OSErr SetDialogTracksCursor(DialogRef theDialog, Boolean tracks)
  472. ;
  473.     IF ¨ GENERATINGCFM THEN
  474.         Macro
  475.         _SetDialogTracksCursor
  476.             move.w              #$0306,D0
  477.             dc.w                $AA68
  478.         EndM
  479.     ELSE
  480.         IMPORT_CFM_FUNCTION SetDialogTracksCursor
  481.     ENDIF
  482.  
  483.     IF OLDROUTINENAMES THEN
  484.     ENDIF
  485. ;
  486. ;*****************************************************************************
  487. ;*                                                                           *
  488. ;* The conditional STRICT_DIALOGS has been removed from this interface file. *
  489. ;* The accessor macros to a DialogRecord are no longer necessary.            *
  490. ;*                                                                           *
  491. ;*****************************************************************************
  492. ;
  493. ;Details:
  494. ;The original purpose of the STRICT_ conditionals and accessor macros was to
  495. ;help ease the transition to Copland.   Shared data structures are difficult
  496. ;to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  497. ;WindowRecord and other data structures, we would begin the migration to 
  498. ;system data structures being completely hidden from applications. 
  499. ;
  500. ;After many design reviews, it was finally concluded that with this sort of
  501. ;migration, the system could never tell when an application was no longer 
  502. ;peeking at a WindowRecord, and thus the data structure might never become 
  503. ;system owned.  Additionally, there were many other limitations in the classic
  504. ;toolbox that were begging to be addressed.
  505. ;
  506. ;The final decision was to leave the traditional toolbox as a compatibility mode.
  507. ;The preferred toolbox API for Copland is a new SOM(tm) based architecture 
  508. ;(e.g. HIWindows.idl).  Windows, menu, controls, etc are each a SOM object 
  509. ;with methods for drawing, event handling, and customization.
  510. ;
  511. ;
  512.     ENDIF
  513.     IF FOR_SYSTEM7_ONLY THEN
  514. ;
  515. ; pascal void CouldDialog(SInt16 dialogID)
  516. ;
  517.     IF ¨ GENERATINGCFM THEN
  518.         _CouldDialog:    OPWORD    $A979
  519.     ELSE
  520.         IMPORT_CFM_FUNCTION CouldDialog
  521.     ENDIF
  522.  
  523. ;
  524. ; pascal void FreeDialog(SInt16 dialogID)
  525. ;
  526.     IF ¨ GENERATINGCFM THEN
  527.         _FreeDialog:    OPWORD    $A97A
  528.     ELSE
  529.         IMPORT_CFM_FUNCTION FreeDialog
  530.     ENDIF
  531.  
  532. ;
  533. ; pascal void CouldAlert(SInt16 alertID)
  534. ;
  535.     IF ¨ GENERATINGCFM THEN
  536.         _CouldAlert:    OPWORD    $A989
  537.     ELSE
  538.         IMPORT_CFM_FUNCTION CouldAlert
  539.     ENDIF
  540.  
  541. ;
  542. ; pascal void FreeAlert(SInt16 alertID)
  543. ;
  544.     IF ¨ GENERATINGCFM THEN
  545.         _FreeAlert:    OPWORD    $A98A
  546.     ELSE
  547.         IMPORT_CFM_FUNCTION FreeAlert
  548.     ENDIF
  549.  
  550.     ENDIF
  551.     ENDIF ; __DIALOGS__ 
  552.  
  553.